import React from 'react'
import { Switch, Route, Redirect } from "react-router-dom"
let Login = React.lazy(() => import("./containers/Login/Login"))
let Register = React.lazy(() => import("./containers/Register/Register"))
let Index = React.lazy(() => import("./containers/Index/Index"))
let Sousuo = React.lazy(() => import("./containers/Sousuo/Sousuo"))

export default function App() {
  return (
    <div>
      <React.Suspense fallback={<div>加载中。。。</div>}>
        <Switch>
          <Route path="/login" component={Login}></Route>
          <Route path="/register" component={Register}></Route>
          {/* <Route path="/home" component={Home}></Route> */}
          <Route path="/index" component={Index}></Route>
          <Route path="/sousuo" component={Sousuo}></Route>
          <Redirect to="/login"></Redirect>
        </Switch>
      </React.Suspense>
    </div>
  )
}


